var form = layui.form()
,upload  = layui.upload
,layedit = layui.layedit
,laydate = layui.laydate
,layer = layui.layer;

/**
 * 编辑器
 */
var editup_url = $("#layedit").attr("_url");
var index = layedit.build("layedit",{
	     uploadImage: {url: editup_url, type: 'post'},
});
form.verify({
    textarea: function(value) { 
        return layedit.sync(index);
    },
    number: function(value){
        if(! /^\d+$/.test(value)){
        	return '请输入数字';
        }
    },
});
/**
 * 表单验证ajax提交
 */
form.on('submit(form)', function(data){
	  var url  = data.form.action;
	  var post = data.field;
	  _ajax(url,post);
	  return false;
});